import React from 'react'
import { Button, message } from 'antd';
import '../../assets/styles/login.css'
import logo from '../../assets/images/images/LoginRegister/logo-blue.png'
import LogoImg from '../../assets/images/images/LoginRegister/photo.png'
import { Checkbox, Form, Input } from 'antd';
import api from '../../apis/Login'
import { useEffect } from 'react';
import { useNavigate } from 'react-router-dom'
const Login = () => {
    const navigate = useNavigate()
    const onFinish = (values) => {
        console.log('Success:', values);
        account(values)
    };
    const onFinishFailed = (errorInfo) => {
        console.log('Failed:', errorInfo);
    };
    function account(values) {
        api.login({ ...values }).then(res => {
            console.log(res);
            if (res.code == 0) {
                // 账号密码错误
                message.error(res.data.msg)
            } else {
                // 账号密码正确，跳转网页
                message.success(res.data.msg)
                localStorage.setItem('token',res.data.token)
                navigate('/home')
            }
        })
    }
    return (
        <div className='logins'>
            
        </div >

    )
}

export default Login